package com.hieu.sms.persist;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.hieu.sms.model.Course;
import com.hieu.sms.model.CourseScoreFactor;
@Repository
@Transactional
public class CourseScoreFactorDaoImpl extends
		AbstractHibernateDAOImpl<CourseScoreFactor, Long> implements
		CourseScoreFactorDao {

	@Override
	protected Class<CourseScoreFactor> getDomainClass() {
		return CourseScoreFactor.class;
	}
	
	@SuppressWarnings("unchecked")
	public List<CourseScoreFactor> findByCourse(Course course){
		Query query = getSession().getNamedQuery("CourseScoreFactor.findByCourse");
		query.setString("depId", course.getDepId());
		query.setString("courseId", course.getCourseId());
		return query.list();
	}

}
